package com.company.cloud.user.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.user.modules.api.request.RoleAddRequest;
import com.company.cloud.user.modules.api.request.RoleGet2DelRequest;
import com.company.cloud.user.modules.api.request.RoleQueryRequest;
import com.company.cloud.user.modules.api.request.RoleUpdateRequest;
import com.company.cloud.user.modules.api.response.RoleModel;
import com.company.cloud.user.modules.api.service.RolePlatformRemoteService;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

import java.util.List;

@Log4j2
@Component
public class RolePlatformRemoteServiceFallbackFactory implements FallbackFactory<RolePlatformRemoteService> {
    @Override
    public RolePlatformRemoteService create(Throwable cause) {
        return new RolePlatformRemoteService() {

            @Override
            public BaseClientResult<List<RoleModel>> roleList(RoleQueryRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<RoleModel> addRole(RoleAddRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<RoleModel> updateRole(RoleUpdateRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<RoleModel> infoRole(RoleGet2DelRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<String> delRole(RoleGet2DelRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<String> reloadCompanyAuth(String companyNo) {
                return BaseClientResult.callbackError();
            }
        };
    }
}
